from sqlalchemy import Column, ForeignKey, Date
from sqlalchemy.orm import relationship
from sqlalchemy.dialects.oracle import VARCHAR2, NUMBER
from app.db.base import Base


# ITE Survey Assigned Association
class ITESurveyAssigned(Base):
    __tablename__ = 'ITE_SURVEY_ASSIGNED'
    __table_args__ = {'schema': 'IARO_CAREER'}

    ite_id        = Column(NUMBER, ForeignKey('IARO_CAREER.ITE_DETAIL.ite_id'), primary_key=True)
    ite_survey_id = Column(NUMBER, primary_key=True)

    # Relationship back to detail
    detail = relationship("ITEDetail", back_populates="surveys_assigned")